import request from '@/utils/request/index.js'
export default {
	
	/**获取直播间信息
	 * @param {Object} roomId
	 */
	getLiveRoomInfo(roomId){
		return request.request({
			url:'/h5/myliveroom/getInfoByNocUserId/' + roomId,
			method:'get',
			data:{},
		})
	},
	/**获取直播间聊天记录
	 * @param {Object} roomId
	 */
	getMsgContent(roomId){
		return request.request({
			url:'/h5/cloudlive/details/' + roomId,
			method:'post',
			data:{},
		})
	},
	/**获取精彩视频
	 * @param {Object} videoSearch
	 */
	getExcellentVideo(videoSearch){
		return request.request({
			url:'/h5/nocvideo/excellentList',
			method:'post',
			data:videoSearch,
		})
	},
	query(id,roomId){
		return request.request({
			url:'/h5/cloudlive/liveInfo',
			method:'post',
			data:{
				userId:id,
				roomId:roomId
			}
		})
	},
	/**记录直播间观看浏览
	 * @param {Object} userId
	 * @param {Object} videoId
	 */
	browseHistory(type,userId,liveroomId,liveStatus){
		return request.request({
			url: '/h5/nocyxbrowse/save',
			method : 'put',
			data:{
				userId:userId,
				type:type,
				businessId:liveroomId,
				liveStatus:liveStatus,
			}
		})
	},
	/**收藏直播间
	 * @param {Object} userId
	 * @param {Object} shoucangFlag
	 * @param {Object} roomId
	 */
	shoucang(userId,shoucangFlag,roomId){
		return request.request({
			url: '/h5/noccloudhome/shoucang',
			method : 'post',
			data:{
				userId:userId,
				shoucangFlag:shoucangFlag,
				roomId:roomId,
			}
		})
	},
	/**获取详情
	 * @param {Object} id
	 */
	query1(id) {
		return request.request({
			url: '/h5/cloudlive/details/' + id,
			method : 'post',
			data:{
			}
		})
	},
	sendLiveMsg(roomId,type,content){
		return request.request({
			url: '/h5/cloudlive/sendMsg',
			method:'post',
			data:{
				roomId:roomId,
				type:type,
				content:content,
			}
		})
	},
	getVisitCount(){
		return request.request({
			url: '/h5/cloudlive/sendMsg',
			method : 'post',
			data:{}
		})
	},
	/**获取直播观看量
	 * @param {Object} roomId
	 */
	refreshVisitCount(roomId){
		return request.request({
			url: '/h5/cloudlive/visitCount/' + roomId,
			method : 'post',
			data:{}
		})
	},
	/**获取电话列表
	 * @param {Object} id
	 */
	getServiceTelList(id) {
		return request.request({
			url: '/h5/userservicetel/getServiceTelByUserId/' + id,
			method : 'post',
			data:{}
		})
	},
	/**
	 * 获取礼物列表
	 */
	getGiftList() {
		return request.request({
			url: '/h5/nocliveroomgift/listNoPage',
			method : 'post',
			data:{}
		})
	},
	/**
	 * 发送红包
	 * @param redMoney
	 * @param redCount
	 * @returns {*}
	 */
	sendRedPackage(redMoney,redCount){
		return request.request({
			url: '/h5/redPackage/send',
			method : 'post',
			data:{
				money:redMoney,
				redCount:redCount,
			}
		})
		
	},
	/**
	 * 抢红包
	 * @param redKey
	 * @returns {*}
	 */
	grabRedPackage(redKey){
		return request.request({
			url: '/h5/redPackage/grab',
			method: 'post',
			data:{redkey:redKey},
		})
	},
	/**
	 * 发送红包消息
	 * @param roomId
	 * @param type
	 * @param content
	 * @param redKey
	 * @param redTitle
	 * @returns {*}
	 */
	sendRedPackageMsg(roomId,type,content,redKey,redTitle){
		return request.request({
			url: '/h5/cloudlive/sendMsg',
			method : 'post',
			data:{
				roomId:roomId,
				type:type,
				content:content,
				redKey:redKey,
				redTitle:redTitle,
			}
		})
	},
	/**直播间发送礼物
	 * @param {Object} id
	 * @param {Object} giftId
	 * @param {Object} roomId
	 */
	liveSendGift(id,giftId,roomId){
		return request.request({
			url:'/h5/nocliveroomgift/sendGift',
			method:'put',
			data:{
				anchorId : id,
				giftId:giftId,
				roomId:roomId,
			},
		})
	},
}

